import { createApp } from 'vue'
import App from './App.vue'
import router from './routers'
import components from './plugins/element-ui'
import myComponents from './components'
import { store, key } from './store'
import './styles/reset.scss'
import './styles/class.scss'
import './styles/index.scss'
import 'element-plus/dist/index.css'
import './utils/permision'

const app = createApp(App)

app.config.globalProperties.$router = router
app.config.globalProperties.$store = store
// 注册elementui
Object.keys(components).forEach(idx => {
  app.use(components[idx])
})
// 注册全局组件
Object.keys(myComponents).forEach(idx => {
  app.component(idx, myComponents[idx])
})

app.use(store, key).use(router).mount('#app')
